<ion-view has-bouncing="true" hide-back-button="true" id="goods-detail-view" style="transform: none" title="商品详情">
  <ion-nav-buttons side="left">
    <button class="button button-clear" ng-click="goBack()">
      <i class="icon ion-chevron-left"></i>
    </button>
  </ion-nav-buttons>
  <ion-content has-bouncing="true">
    <ion-refresher on-refresh="refresh()" pulling-text="下拉刷新..."></ion-refresher>
    <div ng-style="{height: root.allwidth / 4 * 3 + 'px'}">
      <ion-slide-box style="width: 100%; height:100%" auto-play="true">
        <ion-slide ng-show="goods.product_template.imgurl1" style="width: 100%; height: 100%">
          <img alt="" ng-src="{{goods.product_template.imgurl1}}" style="width: 100%; height: 100%"/>
        </ion-slide>
        <ion-slide ng-show="goods.product_template.imgurl2" style="width: 100%; height: 100%">
          <img alt="" ng-src="{{goods.product_template.imgurl2}}" style="width: 100%; height: 100%"/>
        </ion-slide>
        <ion-slide ng-show="goods.product_template.imgurl3" style="width: 100%; height: 100%">
          <img alt="" ng-src="{{goods.product_template.imgurl3}}" style="width: 100%; height: 100%"/>
        </ion-slide>
      </ion-slide-box>
    </div>

    <ul class="list" style="font-size: 18px;">
      <li class="item">
        <div class="goods-name">
          {{goods.name}}
        </div>
        <div style="font-size:14px; color: #d20b19 ">
          {{goods.subname}}
        </div>
        <div class="main-color" style="font-size: 20px; margin-top: 10px">{{goods.kj_price}}
          <span style="font-size: 15px">元
            <del style="color: #aaa; font-size: 13px">市场价：{{goods.product_template.sc_price}}元</del>
          </span>
        </div>
      </li>
      <li class="item item-divider">
        <span ng-show="goods.product_template.sendtype == 3"><img alt="" src="img/hd/icon_choose.png" style="width: 15px">
          次日达</span>
        <span ng-show="goods.product_template.sendtype == 0"><img alt="" src="img/hd/icon_choose.png" style="width: 15px">
          39分钟送达</span>
        <span ng-show="goods.product_template.sendtype == 1"><img alt="" src="img/hd/icon_choose.png" style="width: 15px">
          49分钟送达</span>
        <span ng-show="goods.product_template.sendtype == 2"><img alt="" src="img/hd/icon_choose.png" style="width: 15px">
          59分钟送达</span>
        <span ng-show="goods.product_template.tag">
          <img alt="" src="img/hd/icon_choose.png" style="width: 15px">
          满9元包邮
        </span>
      </li>
      <li class="item item-icon-right" style="height: 70px; font-size: 18px;padding-top: 25px;">
        <span style="color: #aaa">送至</span>
        <span style="color: #5d5d5d; padding-left: 10px; font-weight: 700">{{dist.name}}</span>
        <i class="icon ion-chevron-right" style="color: #eee; font-size: 20px;"></i>
      </li>
      <li class="item" style="height: 70px; font-size: 18px;padding-top: 25px;">
        <span style="color: #aaa">规格</span>
        <span style="color: #5d5d5d; padding-left: 10px; font-weight: 700">{{goods.product_template.scale}}</span>
      </li>
      <li class="item" style="height: 70px; font-size: 18px;padding-top: 25px;">
        <span style="color: #aaa">产地</span>
        <span style="color: #5d5d5d; padding-left: 10px; font-weight: 700;">{{goods.product_template.origin_place}}</span>
      </li>
      <li class="item item-icon-right" ng-show="goods.product_template.sendtype != 4" style="height: 70px; font-size: 18px;padding-top: 25px;">
        <span style="color: #aaa">闪电配送</span>
        <span ng-show="goods.product_template.sendtype == 3" style="line-height: 50px"><img alt="" src="img/hd/ico_cr.png" style="padding-left: 10px;height: 15px"></span>
        <span ng-show="goods.product_template.sendtype == 0"><img alt="" src="img/hd/ico_39.png" style="padding-left: 10px;height: 15px"></span>
        <span ng-show="goods.product_template.sendtype == 1"><img alt="" src="img/hd/ico_49.png" style="padding-left: 10px;height: 15px"></span>
        <span ng-show="goods.product_template.sendtype == 2"><img alt="" src="img/hd/ico_59.png" style="padding-left: 10px;height: 15px"></span>
      </li>
      <li class="item" style="height: 100px; font-size: 18px;padding-top: 25px;" ui-sref="goods.comments( {id: goods.product_id})">
        <div class="left">
          <span style="color: #aaa">商品评价</span>
          <span style="color: #5d5d5d; padding-left: 10px; font-weight: 700">共{{commentcount}}条</span>
          <div ng-init="max=5" style="">
            <span style="float: left; line-height: 30px">总体评分</span>
            <span style="float: right; line-height: 30px">
              <rating max="max" ng-model="rate" readonly="true"></rating>
            </span>
          </div>
        </div>
        <div class="right">
          <span style="line-height: 50px; vertical-align: middle">查看</span>
        </div>

      </li>
      <!-- <li class="item item-divider" style="text-align:center">
        下拉显示商品详情
      </li> -->
    </ul>
    <div ng-style="{height: root.allwidth / 4 * 3 * (goods.product_template? goods.product_template.imgcount : 10) + 40 + 'px'}">

      <div class="goods-detail" ng-bind-html="goods.product_template.product_detail"></div>
    </div>

    <div id="goods-last" style="height: 50px"></div>
  </div>
</ion-content>

<div style="background-color: #fff; position: fixed; bottom: 0px;width: 100%">
  <button class="item piece-btn" ng-click="addCart()" ng-show="goods.status == 0 && goods.default_amount > 0" style="width: 100%">
    加入购物车
  </button>
  <button class="item piece-btn" ng-show="goods.status != 0" style="width: 100%; background-color: #999">
    已下架
  </button>
  <button class="item piece-btn" ng-show="goods.status == 0 && goods.default_amount <= 0" style="width: 100%; background-color: #999">
    已售完
  </button>
</div>
</ion-view>
